package cn.tedu.mydemomvchighly.controller;

import cn.tedu.mydemomvchighly.pojo.entity.User;
import cn.tedu.mydemomvchighly.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
//@RequestMapping(value = "/v1/users/")
@RequestMapping(value = "/api/users/")
public class UserController {


    @Autowired
    IUserService userService;

    @RequestMapping(value = "insert")
    public int insert() {

        userService.insertUser(new User());
        return 1;
    }

    @RequestMapping(value = "userlist")
    public List<User> getUserlist() {
        List<User> users = userService.getUsers();

        return users;
    }

    @RequestMapping(value = "login")
    public void login(User user) {

//        登录中的一些业务处理



//        此次登录功能最后返回的结果
    }
}
